package com.rabbitmq.test;


import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import static com.rabbitmq.config.ConfirmConfig.CONFIRM_QUEUE_NAME;

/**
 * 确认发布的消费者
 */
@Component
@Slf4j
public class ConfirmCallBackComsumer {

    @RabbitListener(queues = CONFIRM_QUEUE_NAME)
    public void reviceCallBackMessage(Message message){
        String msg = new String(message.getBody());
        log.info("接收到的消息为：{}",msg);
    }

}
